cc.Class({
    extends: cc.Component,
    properties: {
        layout: cc.Node,
        selectPos : cc.Label,
        p: {
            default: [],
            type: cc.Node
        }
    },
    init: function (t) {
        for (var e = 0; e < this.p.length; e++) this.p[e].active = !0;
        this.layout.position = t.pos;
        // 不显示选中的星星的颜色，因为不替换一样的颜色
        var n = t.item.getComponent("Star")._starType;
        this.p[n].active = !1, this.callback = t.callback;
    },
    // click: function () {
    //     var tt = this;
    //     this.node.on(cc.Node.EventType.TOUCH_START, function (t) {
    //         tt.selectPos.string = "begin pos : (" + t.getLocation().x + "," + t.getLocation().y + ")";
    //         for (var e = 0; e < this.p.length; e++)
    //             if (this.p[e].active && this.p[e].getBoundingBoxToWorld().contains(t.getLocation())) 
    //                 return cc.log("i:", e),this.callback(e);
    //         //this.callback(this.oldType);
    //     }, this);
    // },
    onClick : function(event,value){
        console.log("select star color:",parseInt(value,10),typeof(value));
        this.callback(parseInt(value,10));
    },
    onLoad: function () {
        //this.click();
    }
})